﻿@namespace CodeManDesktopBlazor.BlazorComponents.Pages.codeTemple
@typeparam K
@typeparam T

@{
	var className = $"{Model.classGenDTO.Name.ToLower().ToTitleCase()}CacheDB";
	string keyList = !Model.classAttributeDTOLst.HasItem() ? "" : Model.classAttributeDTOLst.Where(a => a.IsKey.IsNotNullOrWhiteSpace()).Select(a => a.AName).Aggregate((a, b) => a + "," + b);
	string nokeyList = !Model.classAttributeDTOLst.HasItem() ? "" : Model.classAttributeDTOLst.Where(a => a.IsKey.IsNullOrEmpty()).Select(a => a.AName).Aggregate((a, b) => a + "," + b);
}

<div class="div-code">

	@if (!Model.classGenDTO.Desc.IsNullOrEmpty())
	{
		<p class="p-c">@("\n")/** @("<summary>")</p>
		<p class="p-c">* @Model.classGenDTO.Desc</p>
		<p class="p-c">**/ @("<summary>\n")</p>
	}
	<p class="p-c"> struct @className</p>
	<p class="p-c">{</p> 
	<p class="p-c">@("\n")</p>

	@foreach (var item in Model.classAttributeDTOLst)
	{
		<p class="p-a">@(item.AType.GetDescForIce().GetDescription()) @(item.AName.ToSplitCaseAB()); @(item.ADesc.IsNullOrEmpty()?"":" //"+@item.ADesc)</p>@("\n")
	}

	<p class="p-c">@("\n")</p>
	<p class="p-c">};</p>

</div>

